

package com.hazelcast.test.starter.constructor;

import com.hazelcast.test.starter.HazelcastStarterConstructor;
import com.hazelcast.test.starter.answer.DelegatingAnswer;

import static org.mockito.Mockito.mock;

@HazelcastStarterConstructor(classNames = {"com.hazelcast.spi.impl.operationservice.impl.InvocationFuture", "com.hazelcast.spi.impl.InternalCompletableFuture", "com.hazelcast.spi.impl.DeserializingCompletableFuture"})
public class DelegatingObjectConstructor extends AbstractStarterObjectConstructor {

    public DelegatingObjectConstructor(Class<?> targetClass) {
        super(targetClass);
    }

    @Override
    Object createNew0(Object delegate) throws Exception {
        return mock(targetClass, new DelegatingAnswer(delegate));
    }
}
